home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 233 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: manawatu.planet.co.nz!news
  2. From: ctutty@manawatu.gen.nz (Chris Tutty)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: Wed, 03 Jan 1996 07:39:01 GMT
  6. Organization: PlaNet (NZ) Manawatu, Palmerston Nth, New Zealand +64 6 357-9245
  7. Message-ID: <4cd8fc$oud@news.manawatu.gen.nz>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com>  <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com>  <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie>  <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg>  <4behis$3cl@dux.dundee.ac.uk> <RIGOTTI.95Dec29100514@roach.dra.hmg.gb>
  9. NNTP-Posting-Host: ctutty.manawatu.gen.nz
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Newsreader: Forte Free Agent v0.55
  14.  
  15. I've always disliked HN, not only because it can make the variable
  16. names less readable, but because it violates a basic principle - that
  17. of avoiding unnecessary redundancy.
  18.  
  19. My opionion: HN should not be used in any typed language because it
  20. creates an opportunity for the actual declared type of a variable
  21. (which the machine uses) to be different from it's HN prefix (which
  22. the programmer uses).
  23.  
  24. This is the sort of thing that causes maintenance problems.  To find
  25. out a variable's type you should always search for the initial
  26. declaration.  To make a type-dependent decision on the basis of a
  27. comment is asking for trouble.
  28.  
  29. I agree that it's use within Windows programming helps to clearly
  30. identify variables which connect to Windows objects, but only where
  31. the prefixes are limited to those which are clear and simple.  There's
  32. no point in loooking up a list of prefixes to find out what a
  33. variable's type used to be when the program was originally written.
  34.  
  35. I suppose that if you have to deliver on promises as rapidly as M$
  36. does, then you can't afford luxuries like checking the side-effects of
  37. code changes.  HN lets M$ think that they can treat lines of code in
  38. isolation, allowing changes to be made quickly without the need to
  39. trace the background surrounding the code being changed.  Yes???
  40.  
  41. Chris
  42. ctutty@manawatu.gen.nz
  43.  
  44.